package cmd

import (
	"github.com/micro/cli/v2"
	"github.com/yyangl/micro/broker"
	"github.com/yyangl/micro/registry"
	"math/rand"
	"time"
)

func init() {
	rand.Seed(time.Now().Unix())
}

type Cmd interface {
	App() *cli.App
	Init(opts ...Option) error
	Options() Options
}
type cmd struct {
	opts Options
	app  *cli.App
}

var (
	DefaultCmd     = newCmd()
	DefaultBrokers = map[string]func(...broker.Option) broker.Broker{
		//"service": brokerSrv.NewBroker,
		//"memory":  memory.NewBroker,
		//"nats":    nats.NewBroker,
	}
	DefaultRegistries = map[string]func(...registry.Option) registry.Registry{
		//"service": regSrv.NewRegistry,
		//"etcd":    etcd.NewRegistry,
		//"mdns":    mdns.NewRegistry,
		//"memory":  rmem.NewRegistry,
		//"kubernetes": kreg.NewRegistry,
	}
)
